package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/7
 **/
public class CopeDemo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("001.jpg");
        FileOutputStream fos = new FileOutputStream("001_cp3.jpg");
        long sta = System.currentTimeMillis();
        int len;
        byte[] bytes = new byte[1024 * 10];
        while ((len=fis.read(bytes))!=-1){
            fos.write(bytes,0,len);
        }
        System.out.println("复制完毕");
        long end = System.currentTimeMillis();
        System.out.println("耗时:"+(end-sta)+"ms");
        fis.close();
        fos.close();
    }
}
